﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.Mvc;
using System.Xml;
using Pampa.CRUD.UI.CustomControls;

namespace Pampa.MVC.Controllers
{
    public class EntityEditController : AbstractController
    {
        public JsonResult UpdateValues(string sessionID, string xml)
        {
            var decodedXml = HttpUtility.UrlDecode(xml);
            return BuildResponse(() => EntityEdit.UpdateValues(sessionID, decodedXml));
        }

        public JsonResult Save(string sessionID, string xml)
        {
            var decodedXml = HttpUtility.UrlDecode(xml);
            return BuildResponse(() => EntityEdit.Save(sessionID, decodedXml));
        }
    }
}
